[NET] back: Added tx queue
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 31 Jul 2006 16:29:00 +0000 (17:29 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 31 Jul 2006 16:29:00 +0000 (17:29 +0100)
commit0e81c9938ed27d7f9b83d2116c4127ae9d827722
treeb35a77c0efd5969faecb02a87d61c1ec5f64cc94
parentb4b462732b89593c721f7852a5323ee18fd367ea
[NET] back: Added tx queue

This patch adds a tx queue to the backend if the frontend supports rx
refill notification.  A queue is needed because SG/TSO greatly reduces
the number of packets that can be stored in the rx ring.  Given an rx
ring with 256 entries, a maximum TSO packet can occupy as many as 18
entries, meaning that the entire ring can only hold 14 packets.  This
is too small at high bandwidths with large TCP RX windows.

Having a tx queue does not present a new security risk as the queue is
a fixed size buffer just like the rx ring.  So each guest can only
hold a
fixed amount of memory (proportional to the tx queue length) on the
host.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cannot BUG_ON netbk_queue_full yet !netbk_can_queue, as this can be
triggered by a misbehaving client. Set req_event appropriately when
stopping the packet queue, or we will not receive a notification.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/netback/common.h
linux-2.6-xen-sparse/drivers/xen/netback/interface.c
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c